package com.sali.controller.order;

import com.sali.application.order.OrderService;
import com.sali.commons.BaseController;
import com.sali.utils.methods.jwt.UserInfo;
import com.sali.utils.threadlocal.UserThreadLocal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: sali
 * @date: 2024/7/21 下午2:52.
 * @version: 1.0
 */
@RestController
public class OrderController  extends BaseController {

    @Autowired
    private OrderService orderService;

    @PostMapping("/order/make")
    public boolean makeOrder() {
        UserInfo userInfo = UserThreadLocal.get();
        Long productId = 100L;
        return orderService.makeOrder(userInfo.getId(), productId);
    }


}
